<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Cetakinvoice extends CI_Controller
{
	
	function __construct(){
		parent::__construct();
	}
	
	function index($id_siswa){
		$this->load->model("manual/mod_hasil");
		$this->load->model("web/mod_general");
		$this->load->model("web/mod_main");
		
		
		$data["baseUrl"]			= $this->config->item('base_url');
		$data["siswa"] = $this->mod_hasil->panggil_siswa_doang_transkip($id_siswa);
		$data["saring"] = $this->mod_hasil->model_tampil_print_transkip($id_siswa);
		$data["ulang"] = $this->mod_hasil->siswa_mengulang_transkip($id_siswa);
		$data["transfer"] = $this->mod_hasil->model_tampil_print_transkip_transfer($id_siswa);
		$data["tanggal"] = $this->tgl_indo();

		$data['web_title']				= $this->mod_general->get_web_setting('web_title');
		$data['nama_sekolah']			= $this->mod_general->get_web_setting('front_title');
		$data['moto_sekolah']			= $this->mod_general->get_web_setting('moto_sekolah');
		$data['alamat_sekolah']			= $this->mod_general->get_web_setting('alamat_sekolah');
		$data['telp_sekolah']			= $this->mod_general->get_web_setting('telp_sekolah');
		$data['email']					= $this->mod_general->get_web_setting('email');
		$data['logo']					= $this->mod_general->get_web_setting('web_logo');

		$data['nama_ketua_kampus']		= $this->mod_general->get_web_setting('nama_ketua_kampus');
		$data['nip_ketua_kampus']		= $this->mod_general->get_web_setting('nip_ketua_kampus');
		$data['jabatan_ketua_kampus']	= $this->mod_general->get_web_setting('jabatan_ketua_kampus');
		$data['datamahasiswa']			= $this->mod_main->get_data_pmb($id_siswa);

		// Keterangan Rekening
		// Biaya Pendaftaran
		$data['ket_rekening']			= $this->mod_general->get_web_setting('ket_rekening');
		$data['biaya_pendaftaran']		= $this->mod_general->get_web_setting('biaya_pendaftaran');
		
				
		$this->load->view("engine/manual/cetakinvoice", $data);		
	}	
	
	function tgl_indo(){
		// Menghitung hari
		date_default_timezone_set('Asia/Jakarta'); // PHP 6 mengharuskan penyebutan timezone
		
		//menentukan bulan dalam bahasa indonesia
		$library_sebulan = array("","Januari","Februari","Maret","April","Mei","Juni","Juli","Agustus","September","Oktober","November","Desember");
		$library_angka_bulan = date("n");
		$library_bulan_ini = $library_sebulan[$library_angka_bulan];
		
		// untuk diupload ke database
		$library_kirim_tanggal = date("d")." ".$library_bulan_ini." ".date("Y");
		return $library_kirim_tanggal;
	}

}
?>